package com.itlaobing.service;

import com.itlaobing.mapper.DeptMapper;
import com.itlaobing.pojo.Dept;
import com.itlaobing.util.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptService {
    @Autowired
    private DeptMapper deptMapper;

    /**
     * 获取总条数
     * @param page
     * @return
     */
    public int findCountByPage(PageUtil<Dept> page) {
        return  deptMapper.findCountByPage(page);
    }

    /**
     * 获取分页数据
     * @param page
     * @return
     */
    public List<Dept> findAllByPage(PageUtil<Dept> page) {
        return  deptMapper.findAllByPage(page);
    }
}
